home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
001-025
/
scopedisk19
/
blinker
/
commentcheck.sub
< prev
next >
Wrap
Text File
|
1995-03-18
|
984b
|
47 lines
'---------------------------------------------------------------------------
'
' Comment Check
'
'
' Copyright 1987 by Brian Zupke
'
'
' Scans source line in the form of a character string
' and checks if line is a comment. A comment line will be
' blank or the first nonblank characters will be "'" or
' "rem".
'
SUB CommentCheck.SUB(SourceLine$,LineIsComment) STATIC
LineIsComment = FALSE
Uline$ = UCASE$(SourceLine$)
'
' Find first nonblank character in line
'
CharPos = 1
Nonblank = FALSE
WHILE (NOT Nonblank) AND CharPos <= LEN(Uline$)
IF MID$(Uline$,CharPos,1) <> " " THEN
Nonblank = TRUE
ELSE
CharPos = CharPos + 1
END IF
WEND
'
IF Nonblank THEN
'
' Check if first characters "'" or "REM"
'
IF MID$(Uline$,CharPos,1) = "'" OR MID$(Uline$,CharPos,3) = "REM" THEN
LineIsComment = TRUE
END IF
'
' Blank lines are considered comments
'
ELSE
LineIsComment = TRUE
END IF
END SUB